﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ConvergensDominoConnector;

namespace CDCOSDH
{
    public partial class SubjectHeading : Form
    {
        private string subjectName;
        private ListView listView;

        public SubjectHeading(string subjectName)
        {
            this.subjectName = subjectName;
            this.Text = "Vælg " + this.subjectName;
            InitializeComponent();
        }

        private void btnExpList_Click(object sender, EventArgs e)
        {

            //switch (subjectName.Substring(0,1))
            //{
            //    case "1":
            //        this.dTSubjectHeading.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
            //        this.dTSubjectHeading.RowHeadersVisible = false;

            //        this.dTSubjectHeading.DataSource = DominoConnector.Default.GetSubjectHeadings("emneord.hierarkisk","1");

            //        this.dTSubjectHeading.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.AutoSizeToDisplayedHeaders;

            //        break;
            //    case "2":
            //        break;
            //    case "3":
            //        break;
            //    case "4":
            //        break;
            //    case "5":
            //        break;

            //    default:
            //        break;
            //}
        }

        private void btnAlfaList_Click(object sender, EventArgs e)
        {
            using (FrmListbox frmListbox = new FrmListbox(subjectName.Substring(0, 1), null))
            {
                if (frmListbox.ShowDialog() == DialogResult.OK)
                {
                    this.listView = frmListbox.listView;
                }
                else
                {
                    frmListbox.Close();
                }
            }
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }
    }
}
